function roomStatus() {

    Ajax({

        url: "http://localhost/FIVE_HOTEL/hotel/sever/roomStatus.php",
        success(msg) {
            sessionStorage.setItem("roomInfo", msg)
            const stateMain = document.querySelector("#stateMain")
            const dt = document.querySelector("dt")

            // console.log(stateMain);
            let roomObj = JSON.parse(msg);
            roomObj = roomObj.slice(0, 18);
            // console.log(roomObj);
            roomObj.forEach(item => {
                // console.log(index);
                let str = `
                <dl>
                <dt class ='${item.status}'><span class="iconfont icon-home1-copy"></span></dt>
                <dd>${item.roomAddress}</dd>
                </dl>`               
                stateMain.innerHTML += str;
            });

        }
    })

}
roomStatus();



